home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / faq / comp / aix_faq / part1 next >
Internet Message Format  |  1994-03-30  |  65KB

  1. Path: bloom-beacon.mit.edu!hookup!swrinde!cs.utexas.edu!uunet!ams.amsinc.com!162.70.244.20!jwarring
  2. From: jwarring@fmsaix.amsinc.com (Jeff Warrington)
  3. Newsgroups: comp.unix.aix,comp.answers,news.answers
  4. Subject: AIX Frequently Asked Questions (Part 1 of 3)
  5. Supersedes: <1480@mavrick.UUCP>
  6. Followup-To: comp.unix.aix
  7. Date: 31 Mar 1994 02:39:29 GMT
  8. Organization: American Management Systems, Inc.
  9. Lines: 1894
  10. Approved: news-answers-request@MIT.EDU
  11. Distribution: world
  12. Expires: 30 Apr 94 01:23:45 GMT
  13. Message-ID: <3000@flAIXy.fd.amsinc.com>
  14. Reply-To: jwarring@flAIXy.fd.amsinc.com
  15. NNTP-Posting-Host: flaixy.fd.amsinc.com
  16. Summary: This posting contains a list of Frequently Asked Questions 
  17.          and their answers about AIX, IBM's version of Unix.
  18. Keywords: AIX RS/6000 questions answers
  19. Xref: bloom-beacon.mit.edu comp.unix.aix:22835 comp.answers:4351 news.answers:17013
  20.  
  21. Archive-name: aix-faq/part1
  22. Last-modified: March 23, 1994
  23. Version: 3.00
  24.  
  25.  
  26. Okay, so I still don't quite understand how my first attempt at
  27. posting the FAQ got redirected to for *.answers approval, but hey, if
  28. you'll forgive me I promise the next posting shouldn't take so long!
  29. Thanks to everyone who sent in updates, I appreciate the help!
  30.  
  31.  
  32. Frequently Asked Questions to AIX 3.x and IBM RS/6000
  33. _____________________________________________________
  34.  
  35. This posting contains frequently asked questions and answers about the
  36. IBM RS/6000 series workstations and AIX version 3. All input is very
  37. welcome, please mail to me at basto@cactus.org. You can also use
  38. cs.utexas.edu!mavrick!luis.
  39.  
  40. The list is split into three articles to pass thru most mailers. I'll
  41. usually try to post them once a month to comp.unix.aix, news.answers,
  42. and comp.answers. Please let your input continue as I am most thankful
  43. for all of it.
  44.  
  45. If you see a From: line it means that whatever follows is either an
  46. unabridged or slightly edited version of the input I have received, and
  47. that I may not have verified its contents. If there is no From: line, I
  48. probably know what I am talking about, and the entry is edited from
  49. various sources.
  50.  
  51. All entries are numbered with major and minor subject number, e.g. 
  52. 2.11. If the subject is preceded by an asterisk, that entry has been
  53. changed or added since the last posting.
  54.  
  55. The comp.unix.aix group is for AIX on all IBM platforms -- RT, PS/2,
  56. 370, RS/6000 and mainframes (ESA based on OSF/1), but the traffic has
  57. evolved to discuss predominantly AIX 3.x and the RS/6000. The
  58. newsgroups comp.sys.ibm.pc.rt and comp.sys.ibm.ps2.hardware cover the
  59. RT, mostly hardware and AOS 4.3, and on PS/2 hardware respectively. 
  60. Mark Whetzel posts FAQ lists about RTs in the rt and *.answers groups.
  61. There are few to non-existent discussions on AIX/370 and AIX/ESA.
  62.  
  63. This article covers only AIX 3.x and the RS/6000, except when noted.
  64.  
  65. If you post questions to comp.unix.aix, please be sure to indicate:
  66.  
  67. - the machine type and brief configuration, e.g. Model 540, 64 MB RAM,
  68.   48 MB swap space (this is actually bad), 1.2 GB XYZ hard drive, etc.
  69.   Note: There are now three classes of RS/6000s - the original, RS or
  70.   POWER, RS/2 or POWER2, and PowerPC.
  71.  
  72. - the exact AIX version number, i.e. AIX 3.1 is NOT sufficient, whereas
  73.   AIX 3.1.5 or AIX 3.1 with the 3005 update is. With 3.2 you should
  74.   mention any significant ptfs using the U4xxxxx numbers.
  75.  
  76. I am doing this on my own time. Please do not ask me questions that
  77. should be asked to IBM. If you suspect you have software defect problems
  78. call (800) 237-5511. If you have hardware problems call (800) IBM-SERV.
  79. ______________________________________________________________________________
  80.  
  81. Table of contents:
  82.  
  83. 1.0    General concepts
  84. 1.000  The AIX operating system - what is it?
  85. 1.001  I know neither Unix nor AIX - where do I find more information?
  86. 1.002  What is the Object Database?
  87. 1.003  How do I get rid of the verbose error messages?
  88. 1.004* Which release of AIX do I have?
  89.  
  90. 1.1    SMIT, system administration, file systems
  91. 1.100  I am used to Unix systems programming, why should I learn SMIT?
  92. 1.101  How do I turn off the "running man" in smit?
  93. 1.102  How do I import an /etc/passwd or /etc/group file from another box?
  94. 1.103  Cleaning up utmp, who, and accounting problems
  95. 1.104  How to fsck the root filesystem
  96. 1.105  How can I unmount /usr to run fsck on it?
  97. 1.106  How do I shrink /usr?
  98. 1.107  How do I make a filesystem larger than 2 Gig?
  99. 1.108  How do I see/change system parameters like number of processes per user?
  100. 1.109  How do I shrink the default paging space on hd6?
  101. 1.110  The swapper seems to use enormous amounts of paging space, why?
  102. 1.111  How much paging space do I need?
  103. 1.112  How do I mount a floppy disk as a filesystem?
  104. 1.113  How do I remove a committed lpp?
  105. 1.114  How can I recover space after installing updates?
  106. 1.115  Where are the AIX log files kept?
  107. 1.116  How can I log information about ftp accesses to a file?
  108. 1.117  How do I find a file name from the inode number?
  109. 1.118  How do I set up postscript accounting?
  110. 1.119  How do I create boot diskettes for 3.2?
  111. 1.120* Where can I find tools for performance monitoring?
  112. 1.121  How can I tell what virtual printer a print queue is using?
  113. 1.122  Two srcmstr's are less useful than one?
  114. 1.123  How do I set the tty name associated with a physical port?
  115. 1.124  How do I use mksysb to clone a system?
  116. 1.125  How do I retain timestamps with mksysb?
  117. 1.126* How can I find out the machine type?
  118. 1.127  Updating to 3.2.5
  119. 1.128  AIX fix strategy
  120. 1.129  Are passwords limited to 8 char?
  121. 1.130  How do I increase the number of ptys > 64?
  122. 1.131  CERT advisories on sendmail and xterm
  123.  
  124. 1.2    Backups, tape
  125. 1.200* Some info about tape backups
  126. 1.201  How do I do remote backup?
  127. 1.202  How do I backup a multi-disk volume group?
  128. 1.203  How do I put multiple backups on a single 8mm tape?
  129. 1.204  How can I make an exact duplicate of a tape over the network?
  130. 1.205  What is tape block size of 0?
  131. 1.206  Resetting a hung tape drive...
  132. 1.207* How do I read a mksysb tape with tar?
  133.  
  134. 1.3    Memory and process management
  135. 1.300  Some info about the memory management system
  136. 1.301  How much should I trust the ps memory reports?
  137.  
  138. 1.4    Shells, commands, man pages, InfoExplorer
  139. 1.400  How do I make an informative prompt in the shell?
  140. 1.401  How do I set up ksh for emacs mode command line editing?
  141. 1.402  Listing files with ls causes a core dump
  142. 1.403  How do I put my own text into InfoExplorer?
  143. 1.404  InfoExplorer ASCII key bindings 
  144. 1.405  How can I add new man pages to the system?
  145.  
  146. 1.5    Video, Graphics, X11
  147. 1.500  Which release of X11 do I have?
  148. 1.501  How to prevent ctrl-alt-backspace from killing the X session
  149. 1.502  Who has a termcap/terminfo source for aixterm or the HFT console?
  150. 1.503* How can I look at PostScript files?  Why is "dpsexec" so lousy?
  151. 1.504* unix:0 vs `hostname`:0
  152. 1.505  VT100 key bindings for aixterm
  153. 1.506  Is there a screen saver that does not use excessive CPU?
  154.  
  155. 1.6    Networks and communications
  156. 1.600  My named dies frequently, why?
  157. 1.601  How do I trace ethernet packets on an AIX system?
  158. 1.602  What is the authorized way of starting automount at boot time?
  159. 1.603  How do I set a tty port for both dial-in and dial-out?
  160. 1.604  How to move or copy whole directory trees across a network
  161. 1.605  How can I send mail to hosts that cannot be pinged?
  162. 1.606  How to configure dialup SLIP
  163. 1.607  Where is DCE discussed?
  164. 1.608  How do I make /var/spool/mail mountable?
  165.  
  166. 1.7
  167. 1.8
  168.  
  169. 1.9    Miscellaneous
  170. 1.900  SCSI-1 and SCSI-2 "interoperability" got you confused?
  171. 1.901  How to get your keyboard back after unplugging it from the 6000
  172. 1.902  How do I set up pcsim, the DOS emulator?
  173. 1.903  How do I transfer files between AIX and DOS disks?
  174.  
  175.  
  176. 2.00  C/C++
  177. 2.01  I cannot make alloca work
  178. 2.02  How do I compile my BSD programs?
  179. 2.03  Isn't the linker different from what I am used to?
  180. 2.04* How do I link my program with a non-shared /lib/libc.a?
  181. 2.05  How do I make my own shared library?
  182. 2.06  Linking my program fails with strange error, why?
  183. 2.07* What's with malloc()?
  184. 2.08  Why does xlc complain about 'extern char *strcpy()'
  185. 2.09  Why do I get 'Parameter list cannot contain fewer ....'
  186. 2.10  Why does xlc complain about '(sometype *)somepointer = something'
  187. 2.11  Some more common errors
  188. 2.12* Can the compiler generate assembler code?
  189. 2.13  Curses
  190. 2.14  How do I speed up linking?
  191. 2.15  What is deadbeef?
  192. 2.16  How do I statically link in 3.2?
  193. 2.17  How do I make an export list from a library archive?
  194.  
  195. 3.00  Fortran and other compilers
  196. 3.01  I have problems mixing Fortran and C code, why?
  197. 3.02  How do I statically bind Fortran libraries and dynamically bind
  198.       C libraries?
  199. 3.03  How do I check if a number is NaN?
  200. 3.04  Some info sources on IEEE floating point
  201.  
  202. 4.00  GNU and Public Domain software
  203. 4.01  How do I find PD software?
  204. 4.02  Are there any ftp sites?
  205. 4.03* General hints
  206. 4.04  GNU Emacs
  207. 4.05  gcc/gdb
  208. 4.06  GNU Ghostscript
  209. 4.07  TeX
  210. 4.08  Perl
  211. 4.09* X-Windows
  212. 4.10  bash
  213. 4.11  Elm
  214. 4.12  Oberon 2.2
  215. 4.13  Kermit
  216. 4.14  Gnu dbm
  217. 4.15  tcsh
  218. 4.16  Kyoto Common Lisp
  219. 4.17  Tcl/Tk
  220. 4.18  Expect
  221. 4.19  Public domain software on CD
  222. 4.20  Andrew Toolkit
  223. 4.21  sudo
  224. 4.22  Flexfax and other fax software
  225. 4.23  lsof
  226.  
  227. 5.00  Third party products
  228. 5.01* IBM List of third party products
  229. 5.02  Disk/Tape/SCSI
  230. 5.03  Memory
  231. 5.04  Others
  232. 5.05* C++ compilers
  233. 5.06* Memory leak detectors
  234. 5.07  PPP
  235.  
  236. 6.00  Miscellaneous other stuff
  237. 6.01  Can I get support by e-mail?
  238. 6.02  List of useful faxes
  239. 6.03* List of 3.2 ptfs
  240. 6.04  Some RS232 hints
  241. 6.05  What publications are available for AIX and RS/6000?
  242. 6.06  Some acronyms
  243. 6.07  How do I get this by mailserver or ftp?
  244. 6.08  Hypertext version of the FAQ
  245. 6.09  Where can I send suggestions for tools?
  246.  
  247. 7.00  Contributors
  248.  
  249. ______________________________________________________________________________
  250. 1.000: The AIX operating system - what is it?
  251.  
  252. This is best answered by reading the text files in /usr/lpp/bos. The
  253. README file there contains general information and the BSD files contain
  254. useful information if you know BSD and/or System V.
  255.  
  256. The last release for the RT PC is 2.2.1. The latest release for PS/2s
  257. and Intel architecture machines is AIX 1.3; for PS/2s only, 1.2.1. For
  258. the RS/6000, there are two major levels, 3.1 and 3.2, and various
  259. intermediate levels. IBM has dropped support for 3.1.
  260.  
  261.  
  262. 1.001: I know neither Unix nor AIX - where do I find more information?
  263.  
  264. If you are new to Unix, you should look at the other newsgroups in the
  265. comp.unix hierarchy, in particular comp.unix.questions (for basic
  266. questions) or comp.unix.wizards (for difficult questions). These two
  267. groups have a common FAQ posting as well.
  268.  
  269. If you need information about C programming, try comp.lang.c or
  270. comp.std.c, the latter for Standard ANSI C issues.  comp.lang.c has a
  271. FAQ posting.
  272.  
  273.  
  274. 1.002: What is the Object Database?
  275. From: Uwe Geuder <Uwe.Geuder@informatik.uni-stuttgart.de>
  276.  
  277. AIX stores most of the system management information in /etc/objrepos,
  278. /usr/lib/objrepos, and /usr/share/lib/objrepos. Files (also referred to
  279. as system object classes) in these directories are adminstered by the
  280. Object Database Manager, ODM, which is a set of library routines and
  281. programs providing basic object oriented database facilities.
  282.  
  283. Under most circumstances, only SMIT or the commands SMIT call (see
  284. 1.100) should be used to change the contents of the system object
  285. classes. A harmless way to look at the object database is to use odmget
  286. <Class> where <Class> is one of the files in /etc/objrepos.
  287.  
  288. Experienced users can use the ODM editor, odme, to navigate the database
  289. in detail. Modifying the database should only be attempted if you know
  290. exactly what you are doing.
  291.  
  292.  
  293. 1.003: How do I get rid of the verbose error messages?
  294.  
  295. Many of the messages from the Unix commands are available in different
  296. languages. This is controlled by the LANG environment variable, the
  297. default being En_US meaning English in the US. All the default messages
  298. have a message number associated with them, e.g.:
  299.  
  300. $ cat no-such-file
  301. cat: 0652-050 Cannot open no-such-file.
  302.  
  303. If you prefer the terser Unix-looking error message, set your
  304. environment LANG to C, and you will get:
  305.  
  306. $ cat no-such-file
  307. cat: Cannot open no-such-file.
  308.  
  309.  
  310. 1.004: Which release of AIX or other products do I have?
  311.  
  312. New with 3.2.5: The oslevel command shows OS and component levels.
  313. Run oslevel -help to see options
  314.  
  315. The command 'lslpp -h bos.obj' will show all lines referring to the BOS, 
  316. Basic Operating System.  E.g.:
  317.  
  318. Fix Id  Release         Status    Action     Date       Time     User Name
  319. ------- --------------- --------- ---------- ---------- -------- ---------
  320. Path: /usr/lib/objrepos
  321. bos.obj
  322.         03.02.0000.0000 COMPLETE  COMMIT     12/31/69   18:00:00 root
  323. U401864 03.02.0000.0000 COMPLETE  COMMIT     11/12/92   20:09:35 root
  324. U401968 03.02.0000.0000 COMPLETE  COMMIT     11/12/92   23:18:21 root
  325. U401969 03.02.0000.0000 COMPLETE  COMMIT     11/12/92   23:18:20 root
  326.                  ..........................
  327. U418349 03.02.0000.0000 COMPLETE  COMMIT     08/28/93   15:34:13 root
  328. U419950 03.02.0000.0000 COMPLETE  COMMIT     08/28/93   15:34:11 root
  329.  
  330. For AIX 3.2, you may come across discussions on 3.2.0, 3.2.1, 3.2.2,
  331. 3.2.3 extended, 3.2.4 and 3.2.5.  There is no absolute way to tell which
  332. of these you are running since the newer releases are simply 3.2.0 with
  333. some sets of PTFs added. See above example listing. These selective
  334. fixes could mean there are literally thousands of slightly different
  335. variations of 3.2 in use. Please see section 6 to request some useful
  336. faxes to help with this number game.
  337.  
  338. AIX 3.2.4 and later attempts to resolve this confusion. The OS is
  339. broken down into subsystems so that updates can be applied to an entire
  340. subsystem.  lslpp also sports a new option; use 'lslpp -m bos.obj' to
  341. show what level and update the system is running. You can also use the
  342. new oslevel command. Unless you have a pressing need (such as
  343. applications unsupported on > 3.2.3), it is recommended that you update
  344. to this level. Also see 1.128.
  345.  
  346. ______________________________________________________________________________
  347. 1.100: I am used to Unix systems programming, why should I learn SMIT?
  348.  
  349. Using SMIT is probably very different from your normal way of doing
  350. system administration, but could prove very useful in the long run. In
  351. some areas, in particular TCP/IP, NFS, etc., you can also do things the
  352. normal way, but it is unfortunately difficult to know exactly when the
  353. normal way works. Again, always using SMIT is probably your best way
  354. to go, even when you have to learn a new tool. 
  355.  
  356. What SMIT actually does is build up commands with all required options
  357. to perform the functions requested and execute them. The commands
  358. called and the output they produce are stored in the files smit.script
  359. and smit.log in your home directory. Looking in smit.script may teach
  360. you more about system administration.
  361.  
  362.  
  363. 1.101: How do I turn off the "running man" in smit?
  364.  
  365. Use smitty, the standard curses version or add this line to your .kshrc file:
  366. alias smit="smit -C"
  367.  
  368.  
  369. 1.102: How do I import an /etc/passwd or /etc/group file from another box?
  370.  
  371. Make sure that you run usrck, pwdck (/etc/passwd), and grpck
  372. (/etc/group) to let AIX work its password/group magic.
  373.  
  374.  
  375. 1.103: Cleaning up utmp, who, and accounting problems
  376. From: fritz@scipp.UCSC.EDU (Frederick Staats)
  377.  
  378. This applies if you are running an X11R5 xterm on 3.2.
  379. Add this to the top of X11R5 mit/clients/xterm/main.c:
  380.  
  381. #ifdef AIXV3
  382. #define USE_SYSV_UTMP
  383. #define HAS_UTMP_UT_HOST
  384. #define WTMP_FILENAME "/var/adm/wtmp"
  385. #endif
  386.  
  387. And your utmp problems should go away. If you want xterminal sessions
  388. to go into the wtmp file you need to define -DWTMP in the Imakefile and
  389. be sure the WTMP_FILENAME is set to the right place.
  390.  
  391. The following program by jfh@rpp386.cactus.org (John F. Haugh)
  392. if run in the background by root will clean up the utmp file.
  393.  
  394. #include <sys/types.h>
  395. #include <utmp.h>
  396. #include <fcntl.h>
  397.  
  398. main ()
  399. {
  400.     int    fd;
  401.     struct    utmp    utmp;
  402.  
  403.     while (1) {
  404.         if ((fd = open ("/etc/utmp", O_RDWR)) < 0)
  405.             exit (1);
  406.  
  407.         while (read (fd, &utmp, sizeof utmp) == sizeof utmp) {
  408.             if (utmp.ut_type == USER_PROCESS &&
  409.                     kill (utmp.ut_pid, 0) != 0) {
  410.                 lseek (fd, - (long) sizeof utmp, 1);
  411.                 utmp.ut_type = DEAD_PROCESS;
  412.                 write (fd, &utmp, sizeof utmp);
  413.             }
  414.         }
  415.         close (fd);
  416.         sleep (60);
  417.     }
  418. }
  419.  
  420. Another utmp program was posted to comp.sources.unix, volume 25, issue
  421. 96 by David W. Sanderson (dws@cs.wisc.edu) that also works on AIX 3.1.
  422.  
  423.  
  424. 1.104: How to fsck the root filesystem
  425.  
  426. You can run fsck either in maintenance mode or on mounted filesystems.
  427. Try this:
  428.  
  429.   1. boot from diskette
  430.   2. select maintenance mode
  431.   3. type /etc/continue hdisk0 exit (replace hdisk0 with boot disk if
  432.      not hdisk0)
  433.   4. fsck /dev/hd4
  434.  
  435.  
  436. 1.105: How can I unmount /usr to run fsck on it?
  437. From: accapadi@mathew.austin.ibm.com (Matt Accapadi)
  438. [ This is for 3.2. ]
  439.  
  440. In order to fsck /usr, it has to be unmounted. But /usr cannot be
  441. unmounted because /bin is symbolically linked to /usr/bin. Also
  442. /etc/fsck is symbolically linked to /usr/sbin/fsck.
  443.  
  444. To work around this, when you boot from the boot/maintenance diskettes
  445. and enter maintenance mode, enter "getrootfs hdisk0 sh" instead of
  446. "getrootfs hdisk0" where hdisk0 is the name of the boot disk. Then run
  447. "fsck /dev/hd2".
  448.  
  449.  
  450. 1.106: How do I shrink /usr?
  451. From: mike@bria.UUCP (Michael Stefanik) and Richard Hasting
  452.  
  453. FOR AIX 3.1
  454. -----------
  455.  
  456.  1) Make a backup of /usr
  457.  
  458.         find /usr -print | backup -ivf /dev/rmt0 (or appropriate device)
  459.  
  460.  2) shutdown to maintenance mode
  461.  
  462.         shutdown -Fm
  463.  
  464.  3) export LANG=C
  465.  
  466.  4) remove the filesystem and the logical volume
  467.     ignore an error about the "dspmsg" command not found
  468.  
  469.         umount /usr
  470.         rmfs /usr
  471.  
  472.  5) make a new logical volume hd2 and place it on rootvg with desired size
  473.  
  474.         mklv -yhd2 -a'e' rootvg NNN 
  475.  
  476.    where NNN is the number of 4 meg partitions
  477.  
  478.  6) create a filesystem on /dev/hd2
  479.  
  480.         crfs -vjfs -dhd2 -m'/usr' -Ayes -p'rw'
  481.  
  482.  7) mount the new /usr filesystem and check it
  483.  
  484.         /etc/mount /usr
  485.         df -v
  486.  
  487.  8) restore from the tape; system won't reboot otherwise
  488.  
  489.         restore -xvf/dev/rmt0
  490.  
  491.  9) Sync and reboot the system; you now have a smaller /usr filesystem
  492.  
  493. FOR AIX 3.2
  494. -----------
  495.  
  496.  1) Remove any unneeded files from /usr.
  497.  
  498.  2) Make sure all filesystems in the root volume group are mounted. If
  499.     not, they will not be included in the re-installed system.
  500.  
  501.  3) Type mkszfile. This will create /.fs.size that contains a list of
  502.     the active filesystems in the root volume group that will be
  503.     included in the installation procedure.
  504.  
  505.  4) Edit .fs.size. Change the size of /usr to what you want.
  506.  
  507.     Example: This .fs.size file shows /usr to be 40MB.
  508.  
  509.     rootvg 4 hd2 /usr 10 40 jfs
  510.  
  511.     The 10 is the number of physical partitions for the filesystem and
  512.     the 40 is 40 MB. Most systems have a physical partition size of 4 MB.
  513.     Therefore, the second number (40) will always be 4 times the
  514.     previous number (10). Note, however, that a model 320 with a 120 MB
  515.     drive will have a physical partition size of only 2 MB, and the
  516.     total MB is twice the number of physical partitions. The first
  517.     number (4) in the .fs.size file represents the PP size.
  518.  
  519.     If you want to reduce the size of /usr from 40 MB to 32 MB, edit the
  520.     /usr entry to:
  521.  
  522.         rootvg 4 hd2 /usr 8 32 jfs
  523.  
  524.     IMPORTANT: Make sure that you DO NOT enter a value which is less
  525.     than the size of the filesystem required to contain the current
  526.     data. Doing so will cause the re-installation procedure to fail.
  527.  
  528.  5) chdev -l rmt0 -a block=512 -T
  529.  
  530.  6) Unmount all filesystems that are NOT in the root volume group.
  531.  
  532.  7) Varyoff all user-defined volume groups, if any
  533.  
  534.         varyoffvg VGname
  535.  
  536.  8) Export the user-defined volume groups, if any
  537.  
  538.         exportvg VGname
  539.  
  540.  9) With a tape in the tape drive, type
  541.  
  542.         mksysb /dev/rmt0
  543.  
  544.      This will do a complete system backup, which will include
  545.      information (in the .fs.size file) for the installation procedure
  546.      on how large the filesystems are to be created.
  547.  
  548.  10) Follow the instructions in the Installation Kit under "How to
  549.      Install and perform maintenance from Diskettes" using the
  550.      diskettes and tape that you created in the previous steps.
  551.      DO NOT select the option "Reinstall AIX with Current System
  552.      Settings". Instead use "Install AIX with Current System Settings"
  553.      for the logical volume size changes to take affect.
  554.  
  555.  11) When the installation is complete, you may then import any
  556.      user-defined volume groups.
  557.  
  558.          importvg -y VGname PVname
  559.  
  560.      where "VGname" is the name of the volume group, and "PVname" is
  561.      the name of any one of the physical volumes in the volume group.
  562.  
  563.  12) Varyon your user-defined volume groups
  564.  
  565.          varyonvg VGname
  566.  
  567.  The reduction of the filesystems is now complete.
  568.  
  569.  
  570. 1.107: How do I make a filesystem larger than 2 Gig?
  571.  
  572. The largest filesystem under AIX is 2 Gigabytes because the largest
  573. signed integer is 2**31 - 1.
  574.  
  575. AIX 3.2.5+ can handle filesystems larger than 2 GB.
  576.  
  577.  
  578. 1.108: How do I see/change system parameters like number of processes
  579.        per user?
  580.  
  581. You can use SMIT as described below or simply use lsattr/chdev.
  582. The former will list the current setting as in:
  583.  
  584.   # lsattr -E -l sys0 -a maxuproc
  585.   maxuproc 40 Maximum # of processes allowed per user True
  586.  
  587. and you can then increase the maxuproc parameter:
  588.  
  589.   # chdev -l sys0 -a maxuproc=200
  590.   sys0 changed
  591.  
  592. If you just type 'lsattr -E -l sys0' you will get a list of all
  593. parameters, some of which can be changed but not others.
  594.  
  595. If you want to use smit, do as follows:
  596.  
  597. smit
  598.   System Environments and Processes
  599.     Change / Show Operating System Parameters
  600.       - on this screen you can change by overtyping the following fields:
  601.         - Maximum number of PROCESSES allowed per user
  602.         - Maximum number of pages in block I/O BUFFER CACHE
  603.         - Maximum Kbytes of real memory allowed for MBUFS
  604.       - toggle fields exist for:
  605.         - Automatically REBOOT system after a crash  (false/true)
  606.         - Continuously maintain DISK I/O history (true/false)
  607.  
  608.  
  609. 1.109: How do I shrink the default paging space on hd6?
  610.  
  611. 1) create a paging space to use temporarily
  612.    mkps -s 20 -a rootvg
  613.  
  614. 2) change default paging space hd6 so it is not used at next reboot
  615.    chps -a n hd6
  616.  
  617. 3) For AIX 3.1, edit /etc/rc.boot4 and change swapon /dev/hd6;
  618.    for AIX 3.2, edit /sbin/rc.boot and change swapon /dev/hd6
  619.    swapon /dev/paging00
  620.  
  621. 4) Update information in boot logical volume
  622.    bosboot -a             (3.1)
  623.    bosboot -a -d hdisk0   (3.2)
  624.  
  625. 5) shutdown and reboot
  626.  
  627. 6) remove current hd6 and create a new one of smaller size
  628.    rmps hd6
  629.    mklv -y hd6 -t paging rootvg <size of PS in 4 Meg blocks>
  630.  
  631. 7) Re-edit /etc/rc.boot4 (3.1), /sbin/rc.boot (3.2) to swap to /dev/hd6
  632.    swapon /dev/hd6
  633.  
  634. 8) Update information in boot logical volume
  635.    bosboot -a             (3.1)
  636.    bosboot -a -d hdisk0   (3.2)
  637.  
  638. 9) change current paging device (paging00) so it is inactive at next boot
  639. v   chps -a n /dev/paging00
  640.  
  641. 10) shutdown, reboot, remove paging00 using the command:
  642.     rmps paging00
  643.  
  644. You can check your paging space with `lsps -a`
  645.  
  646. 1.110: The swapper seems to use enormous amounts of paging space, why?
  647.  
  648. When you run ps, you may see a line like:
  649.  
  650. USER   PID %CPU %MEM    SZ   RSS     TT STAT  TIME CMD
  651. root     0 0.0%  14% 386528  8688      -    S 17:06 swapper
  652.  
  653. This is normal behavior, the swapper looks to ps like it has the entire
  654. paging space plus real memory allocated.
  655.  
  656.  
  657. 1.111: How much paging space do I need?
  658.  
  659. See answer 2 in question 1.300.
  660.  
  661.  
  662. 1.112: How do I mount a floppy disk as a filesystem?
  663. From: op@holmes.acc.Virginia.EDU (Olaf Pors)
  664.  
  665. You can build a filesystem on a floppy and mount it, however the
  666. filesystem will be read only. The reason that the filesystem will be
  667. read only is because AIX Version 3.1.5 cannot create a journal log on a
  668. diskette. The intended use is for temporary access to read only data. 
  669. The diskette file system must be unmounted after use and during system
  670. backup procedures or errors could occur.
  671.  
  672. To make the read only filesystem on a floppy:
  673.  
  674. 1. Make a subdirectory on an existing filesystem and place all of the
  675.    files that the diskette will contain into this subdirectory.
  676.  
  677. 2. Enter the following command to create a prototype file containing
  678.    information about the new filesystem, in the example /dir_struct
  679.    is the pathname of the subdirectory created in step 1, and
  680.    proto_filename is the name of the prototype file to be created.
  681.  
  682.          proto /dir_struct > proto_filename
  683.  
  684. 3. Place a formatted floppy into the drive.
  685.  
  686. 4. Edit the prototype file and replace the first line with the following:
  687.  
  688.          <noboot> 0 0
  689.  
  690. 5. Enter the following command to make the filesystem on your floppy:
  691.  
  692.           mkfs -p proto_filename -V jfs /dev/fd0
  693.  
  694. 6. Create the directory upon which you will mount the floppy based
  695.    filesystem, or you can use /mnt. Mount the filesystem:
  696.  
  697.           mount -r -V jfs /dev/fd0 /your_mount_point
  698.  
  699. 7. To unmount the filesystem:
  700.  
  701.           umount /dev/fd0
  702.  
  703. Since the filesystem is read-only it may be of limited use but if you
  704. are going to use it for utility programs and other data that does not
  705. change much, it may still be useful. If you need to change the data,
  706. you can copy the directory from the floppy into another directory, make
  707. your modifications, and remake the filesystem using this procedure.
  708.  
  709.  
  710. 1.113: How do I remove a committed lpp?
  711. From: drb@chmeds.ac.nz (Ross Boswell)
  712.  
  713. This seems to be a common problem. The following script for 3.2 only is
  714. >from IBM NZ AIX software support. As far as I know, it works -- I used
  715. it to remove unwanted fonts. I have no official permission to post it
  716. -- use it at your own risk!
  717.  
  718. #!/bin/ksh
  719. #
  720. # Permanently remove a product from disk and AIX databases
  721. #
  722.  
  723. if [ `whoami` != "root" ] ; then
  724.   echo You must be root to run this script.
  725.   exit 1
  726. fi
  727.  
  728. if [ `uname -a | awk '{print $1$4$3}'` != "AIX32" ] ; then
  729.   echo This script only works on AIX 3.2.
  730.   exit 1
  731. fi
  732.  
  733. TMP_FREE=`df /tmp | awk '$3 ~ /[0-9]/{print $3}'`
  734. if [ "$TMP_FREE" -lt 1000 ] ; then
  735.    echo There is not enough room in your /tmp directory.
  736.    echo You need 1000 KB free, and you have only $TMP_FREE KB free.
  737.    echo Either remove some stuff from /tmp, or use chfs to make it bigger.
  738.    exit 1
  739. fi
  740.  
  741. ODMDIRS="/etc/objrepos /usr/lib/objrepos /usr/share/lib/objrepos"
  742. ODMDIR=/usr/lib/objrepos
  743. export ODMDIR
  744.  
  745. if [ $# -lt 1 ]
  746. then
  747.   echo usage: $0 lppname [lppname ...]
  748.   echo lppname is a string compatible with grep, ie "X11" or "PHIGS"
  749.   echo typing   $0 PHIGS   will remove all LPPs with PHIGS in their name.
  750.   exit 1
  751. fi
  752.  
  753. NAMES=$1
  754. shift
  755. while [ $# -gt 0 ] ; do
  756.   NAMES="$NAMES|$1"
  757.   shift
  758. done
  759. echo "Searching for lpps with egrep \"$NAMES\"...\c"
  760.  
  761. for ODMDIR in $ODMDIRS ; do
  762.   if [ ! -d $ODMDIR -o ! -w $ODMDIR ] ; then
  763.      echo $ODMDIR is not writeable or is not a directory.
  764.      echo I hope this is because you are a /usr client or diskless.
  765.      echo If you are not a diskless or a /usr client, you should stop.
  766.      echo "Enter y to continue ->\c"
  767.      read answer
  768.      if [ "$answer" != "y" ] ; then
  769.        exit 0
  770.      fi 
  771.   fi
  772.   TMP=`odmget lpp | awk -F\" '/name/ {print $2}' | egrep "$NAMES"`
  773.   LPPS=`echo $LPPS $TMP`
  774. done
  775.  
  776. if [ "$LPPS" = "" ]
  777. then
  778.   echo "failed.\nNo LPP with the name $NAMES detected."
  779.   exit 1
  780. fi
  781. echo ok.
  782.  
  783. for ODMDIR in $ODMDIRS ; do
  784.   mkdir -p /tmp/rmlpp/$ODMDIR > /dev/null 2>&1
  785. done
  786.  
  787. > /tmp/listOfFilesToRM$$    # truncate temporary file, just in case.
  788. echo
  789. echo This script is about to attempt to remove an LPP from your system.
  790. echo I say attempt, because it could fail.  If it fails, you may have
  791. echo to at least reload the LPP.  Use the \"lppchk\" command to make sure
  792. echo all is well with your system.
  793. echo
  794. # Loop through all the LPP names found.
  795. for LPP in $LPPS
  796. do
  797.   DESCR=none
  798.   answer=""
  799.  
  800.   # find the LPP ids.  They will be different in the three SWVPD databases.
  801.   for ODMDIR in $ODMDIRS ; do
  802.     # get the lpp id for this ODMDIR (yes, they are different)
  803.     LPPID=`odmget -q name=$LPP lpp | grep lpp_id | sed 's/.* = //'`
  804.  
  805.     # did we find the LPP?
  806.     if [ "$DESCR" = "none" -a "$LPPID" != ""  ] ; then
  807.       # all the descriptions should be the same
  808.       DESCR=`odmget -q name=$LPP lpp | grep description | sed 's/.* = //'`
  809.       echo "Delete $LPP, $DESCR?"
  810.       echo "y or (n) ->\c"
  811.       read answer
  812.       if [ "$answer" != "y" ] ; then # jump back up to the next LPP name
  813.         continue 2
  814.       fi
  815.     fi
  816.     # if there is no DESCR, then we didn't find the LPP.  Weird.
  817.     if [ "$DESCR" = "none" -o "$LPPID" = "" ] ; then
  818.       continue
  819.     fi
  820.     SOMETHING_DONE_FLAG=true
  821.     # Optionally, save the ODM stuff we are about to remove,
  822.     # in case something goes wrong.  The problem is it is difficult
  823.     # to determine if something really did fail, since these commands
  824.     # don't return any decent error return codes.
  825.     odmget -q lpp_id=$LPPID history   > /tmp/rmlpp/$ODMDIR/$LPP.history
  826.     odmget -q name=$LPP lpp           > /tmp/rmlpp/$ODMDIR/$LPP.lpp
  827.     odmget -q lpp_name=$LPP product   > /tmp/rmlpp/$ODMDIR/$LPP.product
  828.     # Get the list of files and links to remove later....
  829.     odmget -q lpp_id=$LPPID inventory > /tmp/rmlpp/$ODMDIR/$LPP.inventory
  830.     awk -F\" '/loc/ {print $2}' /tmp/rmlpp/$ODMDIR/$LPP.inventory | \
  831.       sed 's/,/ /g' >> /tmp/listOfFilesToRM$$
  832.     odmdelete -o history -q lpp_id=$LPPID   > /dev/null 2>&1
  833.     odmdelete -o lpp -q name=$LPP           > /dev/null 2>&1
  834.     odmdelete -o product -q lpp_name=$LPP   > /dev/null 2>&1
  835.     odmdelete -o inventory -q lpp_id=$LPPID > /dev/null 2>&1
  836.   done
  837. done
  838.  
  839. if [ "$SOMETHING_DONE_FLAG" = "true" ] ; then
  840.  
  841.   echo ODM work is done.  Now, time to delete files....
  842.  
  843.   # This could be catastrophic if there is a problem.  For example,
  844.   # if the ODM database for an application had / as one of its files.
  845.   # You be the judge.  Here's your rope....
  846.   cat /tmp/listOfFilesToRM$$ | sort -r | uniq | xargs rm -rf
  847.  
  848.   rm -rf /tmp/listOfFilesToRM$$
  849.   echo done.
  850. fi
  851.  
  852. # take this line out if you want to save your ODM saved files.
  853. rm -rf /tmp/rmlpp
  854.  
  855. exit 0
  856.  
  857.  
  858. 1.114: How can I recover space after installing updates?
  859. From: Milt Cloud <cloud@ux1.cso.uiuc.edu>
  860.  
  861. Note: If you are a /usr server, do not use this because the files
  862.       mentioned below are needed by /usr clients and cannot be deleted.
  863.  
  864. Installp creates numerous files in /usr to clean up after
  865. failed/rejected installs and also for de-installing uncommitted lpps. 
  866. Once you have COMMITted packages you can remove these files safely. 
  867. Depending on your installation activity the numbers can be significant:
  868. hundreds-to-thousands of files, megabytes of data.
  869.  
  870. Files eligible for removal are associated with each "product" you have
  871. installed; the largest collection being due to bos. After
  872. COMMITting bos lpps, you may safely remove all files of the form:
  873.  
  874.               /usr/lpp/bos/deinstl*
  875.               /usr/lpp/bos/inst_U4*
  876.               /usr/lpp/bosadt/deinstl*
  877.         and   /usr/lpp/bosadt/inst_U4*
  878.  
  879. You may repeat this for all additional COMMITted products (e.g.,
  880. bostext1, bosnet, xlc) you have on your system.
  881.  
  882. This problem of lingering install files is a known defect in installp. 
  883. If you have installed PTF U411711 (or any superseder of it: U412397,
  884. U413366, U413425) the deadwood in /usr will not be quite as prevalent. 
  885. No single PTF currently available completely corrects this problem.
  886.  
  887. On my own 320, the following freed up 12.4M in /usr:
  888.  
  889.        # rm -R /usr/lpp/bos/deinstl*
  890.        # rm -R /usr/lpp/bos/inst_U4*
  891.  
  892.  
  893. 1.115: Where are the AIX log files kept?
  894. From: dirk@kimosabi.ucsc.edu (Dirk Coldewey)
  895.  
  896. Such as the equivalent of the SunOS file '/var/log/syslog' and 
  897. '/var/adm/messages'.
  898.  
  899. If you want regular unix syslog files, you can configure syslogd
  900. in /etc/syslog.conf. Here's the one that I use:
  901.  
  902. #
  903. # See the supplied /etc/syslog.conf file for copious comments.
  904. #
  905. *.err;kern.debug;auth.notice;user.none          /dev/console
  906. *.err;kern.debug;daemon,auth.notice;mail.crit;user.none /var/adm/messages
  907. lpr.debug                                       /var/adm/lpd-errs
  908.  
  909. *.alert;kern.err;daemon.err;user.none           operator
  910. *.alert;user.none                               root
  911.  
  912. *.emerg;user.none                               *
  913.  
  914. # for loghost machines, to have authentication messages (su, login, etc.)
  915. # logged to a file, un-comment out the following line and adjust the 
  916. # file name as appropriate.
  917. #
  918. # if a non-loghost machine chooses to have such messages 
  919. # sent to the loghost machine, un-comment out the following line.
  920. #
  921. auth.notice                     /var/log/authlog
  922.  
  923. mail.debug                      /var/log/syslog
  924.  
  925. # following line for compatibility with old sendmails. they will send
  926. # messages with no facility code, which will be turned into "user" messages
  927. # by the local syslog daemon. only the "loghost" machine needs the following
  928. # line, to cause these old sendmail log messages to be logged in the
  929. # mail syslog file.
  930. #
  931. user.alert                       /var/log/syslog
  932. #
  933. # non-loghost machines will use the following lines to cause "user"
  934. # log messages to be logged locally.
  935. #
  936. user.err                         /dev/console
  937. user.err                         /var/adm/messages
  938. user.alert                       `root, operator'
  939. user.emerg                       *
  940.  
  941.  
  942. 1.116: How can I log information about ftp accesses to a file?
  943. From: elr@trintex.uucp (Ed Ravin) and
  944.       map@hal.maths.monash.edu.au (Michael Page)
  945.  
  946. 1) In /etc/syslog.conf, add the line:
  947.    daemon.debug        /tmp/daemon.log
  948.  
  949. 2) # touch  /tmp/daemon.log
  950.    # refresh -s syslogd
  951.  
  952. 3) Modify your inetd.conf so that ftpd is called with the "-l" flag.
  953.    You may also want the "-d" flag. This can be done with 'smit inetdconf'.
  954.  
  955. All the syslog messages from various system daemons should now appear in
  956. the file "/tmp/daemon.log".
  957.  
  958.  
  959. 1.117: How do I find a file name from the inode number?
  960. From: svpillay@berlioz.crs4.it (Kanthan Pillay)
  961.  
  962.      find /mntpoint -xdev -inum nnnn -print
  963.  
  964.  
  965. 1.118: How do I set up postscript accounting?
  966. From: taluskie@utpapa.ph.utexas.edu (Vince Taluskie)
  967.  
  968. Ephraim Vider originally wrote this program to configure postscript page
  969. accounting. It acts as a backend wrapper which logs accounting
  970. information in /etc/qconfig and can be ftp'd from utpapa.ph.utexas.edu
  971. in /pub/aix/psacct.tar.Z.
  972.  
  973. Compile with:
  974.  
  975. cc  pswrap.c -o pswrap -lqb
  976.  
  977. and then make this program suid root:
  978.  
  979. chown root pswrap
  980. chmod u+s pswrap
  981.  
  982. If this step is not done, the printer will hang.
  983.  
  984. Then start up SMIT and go to :
  985.  
  986. Spooler
  987.   Manage Local Printer Subsystem
  988.     Local Printer Queue Devices
  989.       Change / Show Characteristics of a Queue Device
  990.         <Select Queue>
  991.           <Select Device>
  992.  
  993. and change "BACKEND PROGRAM pathname" to the full pathname of pswrap
  994. since pswrap will now handle the backend interface with the queue.
  995.  
  996. A stream of info will be written to a logfile in /tmp (prob lp0.log) but
  997. this file is mainly used for status info and raw pagecounts. If the
  998. accounting data is going to the qconfig-specified acctfile, then use the
  999. 'pac' command to read it. I prefer to have readable ascii data files
  1000. instead, so I just comment out the '#define WANT_PAC' line and it will
  1001. only go to the ACCTFILE specfied in pswrap.c.
  1002.  
  1003. /*  pswrap.c
  1004.  
  1005.  compile with:   cc pswrap.c -o pswrap -lqb
  1006.  (for doc on the qb library see "understanding backend routines in libqb")
  1007.  
  1008.  BTW:  The log_charge() function doesn't seem to do anything,
  1009.        but log_pages() updates the accounting info.
  1010.  
  1011. Ephraim Vider, original author 
  1012.  
  1013. --
  1014. Feb 10, 1993
  1015.  
  1016. You can set pswrap up to use either the accounting file specified in
  1017. /etc/qconfig (which means that you need to get your data from 'pac') or
  1018. you can comment out the #define WANT_PAC line and then the accounting
  1019. data will only go into the ACCTFILE.
  1020.  
  1021. Also modified the logging to the ASCII acctfile so that it looks more
  1022. readable.
  1023.  
  1024. Vince Taluskie
  1025. */
  1026.  
  1027.  #include <stdio.h>
  1028.  #include <string.h>
  1029.  #include <ctype.h>
  1030.  #include <fcntl.h>
  1031.  #include <signal.h>
  1032.  #include <setjmp.h>
  1033.  #include <sys/wait.h>
  1034.  #include <IN/backend.h>
  1035.  #include <IN/standard.h>
  1036.  #include "qprocs.h"
  1037.  
  1038.  char     *nextword (char *p);
  1039.  char     *skipvalue (char *p);
  1040.  
  1041.  #define LOGDIR     "/tmp"
  1042.  #define ACCTFILE   "/usr/adm/acct/lpr/ps-acct"
  1043. /* #define WANT_PAC     1 */     /* this define will also send accounting
  1044.                                  info to the acctfile specified in
  1045.                  /etc/qconfig file.  If this define is 
  1046.                  commented out then accounting info will
  1047.                  only go to ACCTFILE  */
  1048.  
  1049.  
  1050.  char     pcprog[] = "statusdict begin pagecount = end\n\x04";
  1051.  
  1052.  char     *keyw[] = {
  1053.      "idle",
  1054.      "busy",
  1055.      "waiting",
  1056.      "printing",
  1057.      "initializing",
  1058.      NULL
  1059.  };
  1060.  enum     { PS_IDLE, PS_BUSY, PS_WAIT, PS_PRINT, PS_INIT, PS_UNKNOWN };
  1061.  
  1062.  void     giveup();
  1063.  jmp_buf  jumper;
  1064.  
  1065.  char     logfname[30];
  1066.  FILE     *logfile, *acctfile;
  1067.  
  1068.  main (argc, argv)
  1069.  int argc;
  1070.  char     *argv[];
  1071.  {
  1072.      char *devname;
  1073.      int  pagcnt, c;
  1074.      int  pid;
  1075.      int  w, status;
  1076.  
  1077.      if (argc < 2) {
  1078.           fprintf(stderr, "Usage: psbe file\n");
  1079.           exit(-1);
  1080.      }
  1081.      if (log_init(argv[1]) < 0) {
  1082.           fprintf(stderr, "log_init failed!\n");
  1083.           exit(EXITBAD);
  1084.      }
  1085.      sprintf(logfname, "%s/%s.log", LOGDIR, get_device_name());
  1086.      if ((logfile = fopen(logfname, "a")) == NULL) {
  1087.           fprintf(stderr, "Can't open logfile.\n");
  1088.           exit(EXITBAD);
  1089.      }
  1090.  
  1091.      if ((acctfile = fopen(ACCTFILE, "a")) == NULL) {
  1092.      fprintf(stderr, "Can't open logfile.\n");
  1093.      exit(EXITBAD);
  1094.      }
  1095.  
  1096.      setvbuf(logfile, NULL, _IOLBF, BUFSIZ);
  1097.      setvbuf(acctfile, NULL, _IOLBF, BUFSIZ);
  1098.  
  1099.      setvbuf(stdin, NULL, _IONBF, 0);
  1100.      setvbuf(stdout, NULL, _IONBF, 0);
  1101.      fprintf(logfile, "start Job no. %d, queued on %s\n", get_job_number(),
  1102.                get_qdate());
  1103.      log_status(WAITING);
  1104.      pagcnt = getpagecnt();
  1105.      log_status(RUNNING);
  1106.      if ((pid = fork()) < 0) {
  1107.           perror("fork");
  1108.           exit(EXITBAD);
  1109.      }
  1110.      if (pid == 0) {
  1111.           argv[0] = "piobe";
  1112.           execv("/usr/lpd/piobe", argv);
  1113.           perror("exec");
  1114.           exit(EXITBAD);
  1115.      }
  1116.      while ((w = wait(&status)) != pid)
  1117.           if (w == -1) {
  1118.                perror("wait");
  1119.                exit(EXITBAD);
  1120.           }
  1121.      if (WEXITSTATUS(status) != 0)
  1122.           exit(WEXITSTATUS(status));
  1123.      log_status(WAITING);
  1124.  
  1125.      if (pagcnt > 0 && (c = getpagecnt()) > 0) {
  1126. #ifdef WANT_PAC 
  1127.           log_pages(c - pagcnt);
  1128. #endif
  1129.     }
  1130.  
  1131.      fprintf(logfile, "end Job no. %d, queued on %s\n", get_job_number(),
  1132.                get_qdate());
  1133.  
  1134. /* the accounting file format is 
  1135.  
  1136. pages_printed     user     queue_printed_on   time_queued
  1137.  
  1138. */
  1139.  
  1140.      fprintf(acctfile, "%d %35s %7s    %s \n", (c - pagcnt), get_from(), get_queue_name(), get_qdate());
  1141.  
  1142.      fclose(logfile);
  1143.      fclose(acctfile);
  1144.      exit(EXITOK);
  1145.  }
  1146.  
  1147.  void     giveup ()
  1148.  {
  1149.      longjmp(jumper, 1);
  1150.  }
  1151.  
  1152.  getpagecnt ()
  1153.  {
  1154.      int  pc = 0, pstat;
  1155.      char buf[81];
  1156.  
  1157.      if (setjmp(jumper) != 0) {
  1158.           fprintf(logfile, "giving up on status\n");
  1159.           return (0);
  1160.      }
  1161.      alarm(60 * 2);
  1162.      signal(SIGALRM, giveup);
  1163.      do {
  1164.           if (!gets(buf)) {
  1165.                sleep(5);
  1166.                putchar('\x14');    /* ^T returns status */
  1167.                sleep(1); /* wait for answer from printer */
  1168.                if (!gets(buf))
  1169.                     return (0);
  1170.           }
  1171.           fprintf(logfile, "%s\n", buf);
  1172.           if ((pstat = getstatus(buf)) == PS_WAIT) {
  1173.                putchar('\x04');
  1174.                sleep(1);
  1175.           }
  1176.      } while (pstat != PS_IDLE);
  1177.      alarm(0);
  1178.      while (gets(buf))
  1179.           fprintf(logfile, "%s\n", buf);
  1180.      printf("%s", pcprog);
  1181.      sleep(1); /* wait for answer from printer */
  1182.      if (!gets(buf))
  1183.           return (0);
  1184.      if (sscanf(buf, "%d", &pc) != 1)
  1185.           return (0);
  1186.      fprintf(logfile, "%d\n", pc);
  1187.      return (pc);
  1188.  }
  1189.  
  1190.  /*
  1191.   * Parser for printer status messages
  1192.   */
  1193.  
  1194.  getstatus (p)
  1195.  char     *p;
  1196.  {
  1197.      char *t;
  1198.      int  i;
  1199.  
  1200.      if ((p = strchr(p, '%')) == NULL)
  1201.           return (PS_UNKNOWN);
  1202.      if (strncmp(p, "%%[", 3) != 0)
  1203.           return (PS_UNKNOWN);
  1204.      for (p = nextword(p + 3) ; p != NULL ; p = skipvalue(p)) {
  1205.           t = p;
  1206.           p = strchr(p, ':');
  1207.           *p++ = '\0';
  1208.           p = nextword(p);
  1209.           if (strcmp(t, "status") == 0)
  1210.                break;
  1211.      }
  1212.      if (p == NULL)
  1213.           return (PS_UNKNOWN);
  1214.      t = p;
  1215.      p = strchr(p, ' ');
  1216.      if (p[-1] == ';')
  1217.           p--;
  1218.      *p = '\0';
  1219.      for (i = 0 ; keyw[i] != NULL ; i++)
  1220.           if (strcmp(t, keyw[i]) == 0)
  1221.                break;
  1222.      return (i);
  1223.  }
  1224.  
  1225.  char     *nextword (p)
  1226.  char     *p;
  1227.  {
  1228.      while (isspace(*p))
  1229.           p++;
  1230.      if (strncmp(p, "]%%", 3) == 0)
  1231.           return (NULL);
  1232.      return (p);
  1233.  }
  1234.  
  1235.  char     *skipvalue (p)
  1236.  char     *p;
  1237.  {
  1238.      char *t;
  1239.  
  1240.      while (p != NULL) {
  1241.           p = strchr(p, ' ');
  1242.           t = p;
  1243.           p = nextword(p);
  1244.           if (t[-1] == ';')
  1245.                break;
  1246.      }
  1247.      return (p);
  1248.  }
  1249.  
  1250.  /*********    qprocs.h    ***********/
  1251.  /* functions for communication between qdaemon and the backend */
  1252.  
  1253.  char     *get_from();
  1254.  char     *get_to();
  1255.  char     *get_qdate();
  1256.  char     *get_queue_name();
  1257.  char     *get_device_name();
  1258.  char     *get_title();
  1259.  
  1260.  
  1261. 1.119: How do I create boot diskettes for 3.2?
  1262.  
  1263. You need to have four formatted diskettes.
  1264.  
  1265. boot disk:                bosboot -d /dev/fd0 -a
  1266. display disk:             mkdispdskt
  1267. display extension disk:   mkextdskt
  1268. Install/Maintenance disk: mkinstdskt
  1269.  
  1270.  
  1271. 1.120: Where can I find tools for performance monitoring?
  1272.  
  1273. Free X based performance watcher: xsysstats - ftp site ftp.x.org:/contrib
  1274.  
  1275. For 3.2 a few tools are available in /usr/lpp/bosperf. There are tools
  1276. to monitor traces, I/O events, CPU, virtual memory, disk block usage,
  1277. kernel extensions, etc. It even has a simulator, rmss, that allows one
  1278. to try out different memory size configurations to see how it impacts
  1279. performance. See 6.05 for the AIX Performance and Tuning Guide.
  1280.  
  1281.  
  1282. 1.121: How can I tell what virtual printer a print queue is using?
  1283. From: yoder@austin.ibm.com (Stuart R. Yoder)
  1284.  
  1285. Use the command 'lsvirprt'. Don't use any parameters and it will
  1286. run in an interactive mode that will give you a menu of all virtual
  1287. printers on the system with the queue and device for each one.
  1288.  
  1289.  
  1290. 1.122: Two srcmstr's are less useful than one?
  1291. From: hubert@rs530.ncs.mainz.ibm.com (Bernhard Zeller)
  1292.  
  1293. This can happen on systems that have no console, or systems with an
  1294. async terminal as the console but not attached or turned off. One of the
  1295. symptoms is a second srcmstr got run. But the second srcmstr is worthless
  1296. as we can't use the stop/startsrc commands, refresh inetd, qdaemon won't
  1297. start, etc.
  1298.  
  1299. To resolve this, type:
  1300.  
  1301.     smit chgtty
  1302.  
  1303. and add the keyword 'clocal' in following lines:
  1304.  
  1305.    STTY attributes for RUN TIME
  1306.    STTY attributes for LOGIN
  1307.  
  1308.  
  1309. 1.123: How do I set the tty name associated with a physical port?
  1310. From: accapadi@mathew.austin.ibm.com (Matt Accapadi)
  1311.  
  1312. Let's say you wanted to make a tty on the s1 port and call it rs0000
  1313. and a tty on the s2 port and call it rs0001.
  1314.  
  1315. You could run:
  1316.  
  1317. mkdev -c tty -s rs232 -t tty -l rs0000 -p sa0 -w s1   # creates rs0000
  1318. and
  1319. mkdev -c tty -s rs232 -t tty -l rs0001 -p sa1 -w s2   # creates rs0001
  1320.  
  1321.  
  1322. 1.124: How do I use mksysb to clone a system?
  1323. From: joann@ariadne.SLAC.Stanford.EDU (Jo Ann Malina)
  1324.  
  1325. I use the following steps on the master machine to clone an AIX system:
  1326. 1) Remove the password from root.
  1327. 2) Remove the NIS line from the end of the /etc/group file (the last
  1328.    line with the +: )
  1329. 3) Change most of the level '2' designations in /etc/inittab to level
  1330.    '3' to prevent them from being started up when the new system is
  1331.    booted (the minimum ones to change are rc.nfs and rc.tcpip)
  1332. 4) Boot in service mode and change the name and ip address to a "spare"
  1333.    set to avoid address collision.
  1334. 5) Clear /tmp, /usr/tmp and /usr/spool/lpd/stat.
  1335. 6) Run mkszfile and edit it to be sure /usr is as small as possible;
  1336.    then mksysb from the command line.
  1337.  
  1338. The above changes allow me to boot in normal mode the first time, get in
  1339. as root, change the above files back and do the other things necessary
  1340. to configure the new system.
  1341.  
  1342. Then, of course, I go back and clean up and reboot my master machine.
  1343.  
  1344. Note: 1 and 2 lets you log in even if you can't get on the network. 
  1345.    It prevents the login process from trying to reach an NIS server. 
  1346.    Step 2 needed only if you use NIS.
  1347.  
  1348.  
  1349. 1.125: How do I retain timestamps with mksysb?
  1350. From: graeme@ccu1.aukuni.ac.nz ( Graeme Moffat)
  1351.  
  1352. In /usr/lpp/bosinst/bosnet (for net installs), and bosrest (tape), the
  1353. 'pax' commands all have '-pmop' options.  m = "DON'T retain modification
  1354. times".  So, simply change all the '-pmop' to '-pop' and remake
  1355. inst/maint diskettes or mksysb tapes.
  1356.  
  1357.  
  1358. 1.126: How can I find out the machine type?
  1359. From: umar@compsci.cas.vanderbilt.edu (Sait Umar)
  1360.  
  1361. #!/bin/sh
  1362. #
  1363. #  Author G. Vitillaro              (peppe@ipgaix.unipg.it)
  1364. #  from an idea of Marc Pawliger    (marc@ibmpa.awdpa.ibm.com)
  1365. #
  1366. #  10/12/92  GVT  First (and last) implementation
  1367. #
  1368. # machine : will get machine type on RISC/6000
  1369. #
  1370. #
  1371. awk '
  1372.         BEGIN {
  1373.                 m["10"]="7013/530 or 7016/730";
  1374.                 m["11"]="7013/540";
  1375.                 m["14"]="7013/540";
  1376.                 m["18"]="7013/530H";
  1377.                 m["1C"]="7013/550";
  1378.                 m["20"]="7015/930";
  1379.                 m["2E"]="7015/950";
  1380.                 m["2E"]="7015/950E";
  1381.                 m["30"]="7013/520";
  1382.                 m["31"]="7012/320";
  1383.                 m["34"]="7013/520H";
  1384.                 m["35"]="7012/320H or 320E";
  1385.                 m["37"]="7012/340";
  1386.                 m["38"]="7012/350";
  1387.                 m["41"]="7011/220";
  1388.                 m["43"]="7011/M20";
  1389.                 m["46"]="250/PowerPC";
  1390.                 m["47"]="230/RSC";
  1391.                 m["5C"]="7013/560";
  1392.                 m["63"]="7015/970";
  1393.                 m["64"]="7015/980";
  1394.                 m["66"]="7015/580";
  1395.                 m["67"]="7015/570";
  1396.         m["70"]="590/POWER2";
  1397.             m["71"]="580H";
  1398.                 m["75"]="7012/370, 375, or 37T";
  1399.                 m["76"]="7012/360, 365, or 36T";
  1400.                 m["77"]="7012/350, 355, or 7013/550L";
  1401.                 m["78"]="7012/315 or 7013/510 ";
  1402.             m["80"]="990/POWER2";
  1403.  
  1404.     You should request anyone with a model N40 run 'uname -m | cut -c9-10'
  1405.     so you can add an entry for it.
  1406.                 if ( m[code] != "" )
  1407.                         print "This RISC/6000 is a " m[code];
  1408.                 else
  1409.                         print "Unknown Machine";
  1410.         }
  1411. ' code=`uname -m | cut -c9-10` < /dev/null
  1412.  
  1413.  
  1414. 1.127: Updating to 3.2.5
  1415. From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)
  1416.  
  1417. (Ed.  The following is useful if you have to update a large number of
  1418. systems, large being > 3.)
  1419.  
  1420.    *** WARNING : Modify the scripts if you need dataless, diskless   ***
  1421.    ***           or remote /usr support.                             ***
  1422.  
  1423. 1) Receive the PMP3250 tape from your AIX support center the PTF number
  1424.    is U493250.
  1425.  
  1426. 2) Create a filesystem with 240 MB of space (60 PP's) and mount it as
  1427.  
  1428.    /dev/pmp3250  -  /pub/pmp3250
  1429.  
  1430. 3) Insert the tape (blocksize is 512) and install PTF U422467
  1431.  
  1432.    # installp -BXacgq -d /dev/rmt0 bos.obj 3.2.0.0.U422467
  1433.  
  1434. 4) Use the following script to load the tape in the new filesystem
  1435.  
  1436.    # cd /pub/pmp3250
  1437.    # mktape2disk.sh 0 447             <<-- read 447 files from rmt0
  1438.  
  1439. =-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
  1440. #!/bin/ksh
  1441. # @(#) mktape2disk.sh  creates files from tape on disk.
  1442.  
  1443. # change name prefix here
  1444. NAME="f"
  1445.  
  1446. # from file #i to file #j
  1447. integer i=1
  1448. integer j
  1449.  
  1450. # test arguments
  1451. if [ -z "${1}" ]
  1452. then
  1453.   echo "\nusage: $(basename ${0}) <drive_no> <#files>\n"
  1454.   echo "\t<drive_no>: tape drive number (e.g. 0)"
  1455.   echo "\t<#files>  : number of files to copy from the tape\n"
  1456.   exit 1
  1457. fi
  1458. device=/dev/rmt${1}.1
  1459.  
  1460. # test arguments
  1461. if [ -z "${2}" ]
  1462. then
  1463.   echo "\nusage: $(basename ${0}) <drive_no> <#files>\n"
  1464.   echo "\t<drive_no>: tape drive number (e.g. 0)"
  1465.   echo "\t<#files>  : number of files to copy from the tape\n"
  1466.   exit 1
  1467. fi
  1468. j=${2}
  1469.  
  1470. tctl -f ${device} rewind
  1471. if [ $? -ne 0 ]
  1472. then
  1473.   exit 1
  1474. fi
  1475.  
  1476. # create tape
  1477. while [ ${i} -le ${j} ]
  1478. do
  1479.     echo "Copy file #${i} of #${j} from (${device}) to disk as (${NAME}${i})."
  1480.     dd if=${device} of="${NAME}${i}" bs=200k
  1481.     i=i+1
  1482. done
  1483. tctl -f ${device} rewind
  1484. exit 0
  1485. =-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
  1486.  
  1487. 5) Create a new .toc file
  1488.  
  1489.    # cd /pub/pmp3250
  1490.    # inutoc .
  1491.    # pg .toc
  1492.  
  1493. 6) Place the following file named 'runme.sh' in the PMP directory
  1494.  
  1495. =-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
  1496. #!/bin/ksh
  1497. # @(#) runme.sh for PMP3250
  1498. #
  1499. INSTP="/usr/sbin/installp"
  1500. LOG="/tmp/installp.log"
  1501. TEE="/usr/bin/tee"
  1502. PATCHDIR=$(pwd)
  1503. #
  1504. /usr/bin/cp /usr/lpp/info/data/ispaths /usr/lpp/info/data/ispaths.save
  1505. #
  1506. INFODIR="/usr/lpp/info/$LANG/aixmin"
  1507. /usr/bin/mkdir ${INFODIR} 2>/dev/null >/dev/null
  1508. if [ ! -w ${INFODIR} ]
  1509. then
  1510.     print "\n\t*ERROR* Can not (write) access [${INFODIR}]."
  1511.     print "\tPlease unmount CD or NFS filesystems.\n"
  1512.     exit -1
  1513. fi
  1514. #
  1515. # Commit all ptf's
  1516. #
  1517. ${INSTP} -Xc all 2>&1 | ${TEE} ${LOG}.0
  1518. #
  1519. # Install latest installp patch
  1520. #
  1521. ${INSTP} -BXacgq -d ${PATCHDIR} bos.obj 3.2.0.0.U422463 2>&1 | ${TEE} ${LOG}.1
  1522. #
  1523. # Install latest installp patch
  1524. #
  1525. ${INSTP} -BXacgq -d ${PATCHDIR} bos.obj 3.2.0.0.U422467 2>&1 | ${TEE} ${LOG}.6
  1526. #
  1527. # Run the ptfdir clean utility.
  1528. #
  1529. /usr/sbin/ptfdir_clean -y -f -v 2>&1 | ${TEE} ${LOG}.2
  1530. #
  1531. # Install the PMP.    Version 1
  1532. #
  1533. /usr/lib/instl/sm_inst installp_cmd   \
  1534.         -T m -q -a -g -B              \
  1535.         -d ${PATCHDIR}                \
  1536.         -S '3250 AIX Maintenance Level U493250' \
  1537.         -c  -N  -X                    \
  1538.         2>&1 | ${TEE} ${LOG}.3
  1539. #
  1540. # Install the PMP.    Version 2
  1541. #
  1542. # /usr/sbin/update_all
  1543. #
  1544. # Install latest installp patch
  1545. #
  1546. /usr/bin/lppchk -v | ${TEE} ${LOG}.4
  1547. #
  1548. # Show level of installp patch
  1549. #
  1550. /usr/bin/lslpp -m bos.obj | ${TEE} ${LOG}.5
  1551. #
  1552. # Guess you should reboot now.
  1553. #
  1554. sync;sync
  1555. print - "\n\n\tDone......guess you should reboot now !!\n"
  1556. exit 0
  1557. =-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
  1558.  
  1559. 7) To run the update on your server
  1560.  
  1561.    ===>> Please read the Installation Instructions first <<==
  1562.  
  1563.    # cd /pub/pmp3250
  1564.    # ./runme.sh
  1565.  
  1566.                    ........WAIT...........
  1567.  
  1568.    # /etc/shutdown -Fr
  1569.  
  1570. 8) NFS export the PMP dir as READ-ONLY to all your clients.
  1571.  
  1572. 9) To update a client system
  1573.  
  1574.     a -  Mount the PMP filesystem from the server
  1575.     b -  cd <mounted_filesystem>
  1576.     c -  execute ./runme.sh
  1577.     d -  Unmount PMP filesystem
  1578.     e -  reboot
  1579.  
  1580. 10) To create a copy 1:1 of the tape you received use the script 'mktape.sh'
  1581.  
  1582.    # cd /pub/pmp3250
  1583.    # mktape.sh 0
  1584.  
  1585. =-=-=-=-=-=-=-= cut here =-=-=-=-=-=-=-=-=-=-=
  1586. #!/bin/ksh
  1587. # @(#) mktape.sh: creates a bootable tape from images on disk
  1588.  
  1589. # change name prefix here
  1590. NAME="f"
  1591.  
  1592. # usage: mktape drive_no
  1593. #        drive_no = tape drive number
  1594. # test arguments
  1595. if [ -z "${1}" ]
  1596. then
  1597.   echo "\nusage: mktape <drive_no>"
  1598.   echo "         <drive_no>: tape drive number (e.g. 0)\n"
  1599.   exit 1
  1600. fi
  1601. device=/dev/rmt${1}.1
  1602.  
  1603. tctl -f ${device} rewind
  1604. if [ $? -ne 0 ]
  1605. then
  1606.   exit 1
  1607. fi
  1608.  
  1609. # create tape
  1610. i=1
  1611. while test -r "${NAME}${i}"
  1612. do
  1613.     echo "copy ${i}"
  1614.     if [ $i -le 3 ]
  1615.     then
  1616.       dd if="${NAME}${i}" of=${device} conv=sync bs=1k
  1617.     else
  1618.       dd if="${NAME}${i}" of=${device} bs=200k
  1619.     fi
  1620.     let i=${i}+1
  1621. done
  1622. tctl -f ${device} rewind
  1623. exit 0
  1624.  
  1625.  
  1626. 1.128: AIX fix strategy
  1627. From: leedp@austin.ibm.com (Dennis Lee, PMP Release Manager)
  1628.  
  1629. First, a little history...
  1630.  
  1631. The maintenance strategy for AIX 3.1 was cumulative updates. Every few
  1632. months, we'd put all available fixes in one large package and ship it. 
  1633. There was no real strategy for providing a single fix. Although we'd
  1634. occasionally produce an emergency patch, there was no method for
  1635. tracking them; if you got a second one, it might overwrite the first. 
  1636. So, after a few of these patches, it's hard to track.
  1637.  
  1638. In AIX 3.2 we introduced a "selective fix" strategy to support
  1639. individual fixes. The package contained information about other fixes
  1640. that were required for that fix to work correctly. For example, a Korn
  1641. shell fix might require a change in libc.a, which might in turn require
  1642. a fix in the kernel. This strategy allowed us to keep track of which
  1643. fixes were installed to make sure we didn't overwrite one with another,
  1644. and make sure they all worked together. But the initial selective fix
  1645. design still had a few problems.
  1646.  
  1647.   o None of the fixes were cumulative.  If you got a fix for Korn shell,
  1648.     you may not receive all of the fixes for Korn shell.  This left the
  1649.     possibility of rediscovering other problems that were already fixed.
  1650.  
  1651.   o Since we chose to fix everything possible that was reported as a
  1652.     problem, instead of deferring them to the next release, the number
  1653.     of available fixes became quite large.
  1654.  
  1655.   o The number of additional fixes required by any given fix could also
  1656.     be quite large.  Since the installation program ran once for each
  1657.     fix, the size and complexity of the fix packages grew, and
  1658.     installation time lengthens greatly.
  1659.  
  1660. While developing the AIX 3.2.4 upgrade, we undertook a large effort to
  1661. resolve the selective fix concerns, and dramatically increase the
  1662. quality of AIX 3.2.  The base operating system and most of the optional
  1663. program products were split into subsystems.  A subsystem is a group of
  1664. logically related files.  The division was made such that changes to a
  1665. given subsystem were less likely to affect other subsystems.  In total
  1666. there are approximately 500 subsystems, but in practice, files have been
  1667. modified in only about half of them.  The advantages of the new
  1668. packaging strategy are:
  1669.  
  1670.   o Each subsystem package is cumulative, containing all of the fixes
  1671.     and enhancements to date for that subsystem.
  1672.  
  1673.   o The cumulative subsystem package is tested as an entity.
  1674.  
  1675.   o The number of fix packages is greatly reduced because the number of
  1676.     subsystems is far fewer than the number of fixes and enhancements.
  1677.  
  1678.   o The number of other fixes required by any given fix is also greatly
  1679.     reduced because a subsystem package has requisites only on other
  1680.     subsystem packages.
  1681.  
  1682.   o The reduced number of fix packages greatly reduced installation time.
  1683.  
  1684. Some customers also told us that they liked the maintenance level
  1685. strategy that we used in AIX 3.1.  They liked being able to install all
  1686. of the known fixes, and they liked knowing what "level" of AIX they had. 
  1687. To meet these requirements, we produced a Preventive Maintenance Package
  1688. (PMP).  The PMP is simply a collection of the latest cumulative
  1689. subsystem packages tied together in such a way that it can be installed
  1690. by selecting a single fix.  We also added flags to the lslpp command and
  1691. added a new command, oslevel, to show which PMP is installed.  Now we
  1692. had both! The good attributes of selective fix along with the good
  1693. attributes of maintenance levels. 
  1694.  
  1695. A few Q&As: 
  1696.  
  1697. Q. Why is the fix I just received 130 megabytes!@#? I already have the
  1698. AIX 3.2.4 update installed!
  1699. A. Your fix may be part of the AIX 3.2.5 update. AIX 3.2.5 is another
  1700. PMP that contains all of the fixes to date, as well as enhancements 
  1701. to support the PowerPC model 250, and the new high-end RS/2 models
  1702. 590 and 990, as well as support for new disk and tape drives, graphics
  1703. adapters and more.
  1704.  
  1705. Q. Why can't you just build my fix on 3.2.4? 
  1706. A. There really isn't such a thing as 3.2.1 or 3.2.2 or even 3.2.4. 
  1707. They're just collections of fixes and enhancements built on a 3.2 base. 
  1708. If the fix for your problem was built prior to 3.2.5, you can get the
  1709. older version. But if your fix was built for the first time in a 3.2.5
  1710. subsystem, that's the only version of the fix that exists.
  1711.  
  1712. See also 6.02.
  1713.  
  1714.  
  1715. 1.129: Are passwords limited to 8 char?
  1716.  
  1717. AIX passwords are only significant to 8 characters. You can set a
  1718. passwd to more than 8 characters but anything over eight are ignored.
  1719. No messages or warnings are given.
  1720.  
  1721. Be careful if you're running NIS. You probably want to limit passwords
  1722. to 8 char on all machines (6000 and others) to be compatible.
  1723.  
  1724. Someone mentioned that DCE supports kerberos which supports passwords
  1725. greater than 8 characters.
  1726.  
  1727.  
  1728. 1.130: How do I increase the number of ptys > 64?
  1729. From: mick@oahu.cern.ch (Mickey Coggins)
  1730.  
  1731. SMIT only allows 64. Try this:
  1732.  
  1733. odmget -q"attribute=num and uniquetype=pty/pty/pty" PdAt |
  1734. sed "s/0-64/0-512/" |
  1735. odmchange -q"attribute=num and uniquetype=pty/pty/pty" -o PdAt
  1736.  
  1737. chdev -l pty0 -anum=256 -P
  1738. reboot
  1739.  
  1740.  
  1741. 1.131: CERT advisories on sendmail and xterm
  1742.  
  1743. The following fixes are available for some CERT advisories on problems
  1744. with sendmail and xterm.
  1745.  
  1746. sendmail        - fix available as U426396
  1747. xterm for X11R4 - fix available as U422575
  1748. xterm for X11R5 - fix available as U425811
  1749.  
  1750.  
  1751. 1.200: Some info about tape backups
  1752. From: Craig Anderson
  1753.  
  1754. The following supplements the information on rmt devices in
  1755. InfoExplorer. It is based on my own personal experience with IBM tape
  1756. drives running on AIX 3.1. No warranty is expressed or implied.
  1757.  
  1758. CONFIGURING THROUGH SMIT:
  1759.     BLOCK size (0=variable length)        (ALL)
  1760.     Sets the tape block size.  When reading, the block size must be
  1761.     set to the block size set when the tape was written.  When
  1762.     using some commands, tapes written with ANY block size can be
  1763.     read if the block size is set to 0 (variable length) (see
  1764.     "BLOCK SIZES" below).
  1765.  
  1766.     Use DEVICE BUFFERS during writes        (ALL)
  1767.     Set to yes, the device will buffer data internally on writes.
  1768.     This greatly improves performance, but under certain cases may
  1769.     be undesirable since the data is not written to tape before
  1770.     returning a good indication.
  1771.  
  1772.     Use EXTENDED file marks            (8mm only)
  1773.     Extended file marks take up much more space than short (or
  1774.     non-extended) file marks.  But extended file marks can be
  1775.     overwritten, allowing data not at the beginning of tape to be
  1776.     overwritten (see "FILE MARKS" below).
  1777.  
  1778.     RETENSION on tape change or reset        (1/4" only)
  1779.     If set to "no" then the tape will not be retentioned
  1780.     automatically when the tape is inserted.  Note that this will
  1781.     take effect only after the device is used.
  1782.  
  1783.  
  1784. FILE MARKS:
  1785.      Tape devices support multiple tape files.  Tape files are the
  1786.      result of a backup/cpio/tar/dd type command, where the device is
  1787.      opened, written to, and closed.  Because tapes allow large
  1788.      quantities of data to be written on a single tape, several backups
  1789.      (that is, tape files), may be combined on one physical tape.
  1790.      Between each tape file is a "tape file mark" or simply "file
  1791.      mark".  These file marks are used by the device driver to indicate
  1792.      where one tape file ends and another begins.
  1793.  
  1794.                               B       E
  1795.                    <-------   O       O   ------->
  1796.                               T       T
  1797.               __ ____________________________ _______________
  1798.      physical | \            |       |      \             |physical
  1799.      beginning|  \           | tape  |       \            | end
  1800.        of     |   \          | file  |        \           |  of
  1801.       tape    |    \         | mark  |         \          | tape
  1802.               |_____\________|_______|__________\_________|
  1803.  
  1804.      Note that there is a distinction between the beginning of tape
  1805.      (BOT) side of a file mark and the end of tape (EOT) side of a file
  1806.      mark.  If the head is on the BOT side of a file- mark, "tctl fsf
  1807.      1" command will move only to the EOT side of the same file mark.
  1808.  
  1809.      With the 1/4" tape drive, writing can only take place
  1810.      sequentially, or after blank tape has been detected.  You cannot
  1811.      write over data on the tape (except at BOT).  If you wish to add
  1812.      data to a tape which has been written and then rewound you should
  1813.      space forward file mark until an error occurs.  Only then can
  1814.      you start writing again.
  1815.  
  1816.      With an 8mm tape drive, writing can only take place before blank
  1817.      tape, an EXTENDED file mark, or at BOT.  Thus if several backups
  1818.      have been made on one tape and you wish to overwrite one of the
  1819.      backups, position the tape to the place you wish to start writing
  1820.      and issue the following commands:
  1821.     tctl bsf 1
  1822.     tctl eof 1
  1823.      The first command skips back to the BOT side of the same file
  1824.      mark.  The second command rewrites the file mark (writing is
  1825.      allowed before extended file marks).  The erase head will erase
  1826.      data ahead of the write head, so that after writing the file mark
  1827.      the head will be positioned before blank tape.  Only after this
  1828.      may you start writing over data in the middle of the tape.  (All
  1829.      data beyond where you are currently writing will be lost).  Note
  1830.      that you cannot write over short file marks.  In order for this to
  1831.      work, the tape must have been written with extended file marks
  1832.      (use smit to change this).
  1833.  
  1834.      With the 9-track drive writing can take place anywhere on the
  1835.      tape although overwriting single blocks of data is not supported.
  1836.  
  1837.      On the 8mm drive extended filemarks use 2.2 megabytes of tape and
  1838.      can take up to 8.5 seconds to write.  Short filemarks use 184K
  1839.      and take up to 1.5 seconds to write.
  1840.  
  1841. BLOCK SIZES:
  1842.      When data is written to tape it is written in blocks.  The blocks
  1843.      on a tape are separated by inter-record gaps.  It is important to
  1844.      understand the structure of the written tape in order to
  1845.      understand the problems which can occur with changing block
  1846.      sizes.
  1847.  
  1848.      In fixed block size mode all blocks on the tape are the same
  1849.      size.  They are the size of the block size set in the device
  1850.      configuration.  All read()s and write()s to the tape drive must be
  1851.      a multiple of the fixed block size.
  1852.  
  1853.      In fixed block mode a read() will return as many blocks as needed
  1854.      to satisfy the read() request.  If a file mark is encountered
  1855.      while reading the tape only the data up until the file mark will
  1856.      be returned.
  1857.  
  1858.      It is not possible for the tape drive to read a tape whose block
  1859.      size is not the same as the block size in the device
  1860.      configuration.  (Unless the device configuration is in variable
  1861.      size blocks.)
  1862.  
  1863.      In variable block size (0) mode, the blocks written on the tape
  1864.      are the size of the read() and write() requests to the device
  1865.      driver.  In this case, the actual block sizes on the tape can be
  1866.      changed using the options to the backup commands (tar -C, cpio -C,
  1867.      backup -C).
  1868.  
  1869.      In variable mode, read() requests greater than size of the block
  1870.      on the tape will return only the data from the next block on the
  1871.      tape.  It is this feature that allows tapes written in any block
  1872.      size (fixed or variable) to read with the dd command (the output
  1873.      from the dd command may be piped to restore, tar, or cpio for
  1874.      example.)  Note that backup, tar, and cpio cannot read all tapes
  1875.      by using a large block size because they assume there is an error
  1876.      if they get a short read().
  1877.         dd ibs=128k obs=16k if=/dev/rmt0 | ...
  1878.  
  1879.      The tape head is always positioned at an inter-record gap, file
  1880.      mark, or blank tape after reading or writing.
  1881.  
  1882.      With the 8mm tape drive, using a fixed block size which is not a
  1883.      multiple of 1K is inefficient.  The 8mm tape drive always writes
  1884.      internally in 1K blocks.  It simulates the effect of variable
  1885.      block sizes, but, for example, using a fixed block size of 512
  1886.      bytes (or using variable block size and write()ing 512 bytes at a
  1887.      time) wastes one half of the tape capacity and gives only one half
  1888.      the maximum transfer rate.
  1889.  
  1890.  
  1891. EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
  1892.      Many tape drives support both variable and fixed block sizes.
  1893.  
  1894.      Variable block mode writes block sizes the size of the write
  1895.      command issued (tar and backup specify this with the -b option). 
  1896.      In fixed mode, block sizes are fixed and all writes must be a
  1897.      multiple of the fixed block size.
  1898.  
  1899.      Unix often internally chops larger reads and writes up into
  1900.      manageable pieces (often 65535, 65534, or 65532 bytes) before
  1901.      doing the actual reads and writes.  This means reads and writes of
  1902.      64K bytes are often broken up into a 65535 byte record and a 1
  1903.      byte record (In fixed mode the write will fail).  Block sizes >=
  1904.      64K (-C128 and greater) should be avoided for this reason.  AIX
  1905.      does not break up read and write requests, but be aware of the
  1906.      situation on other machines.
  1907.  
  1908.      If the tape is written in an unknown block size then set the
  1909.      device configuration in smit to use variable size blocks, use the
  1910.      "dd" command with a large input block size, and pipe it to the
  1911.      restore command.  For example:
  1912.       chdev -l rmt0 -a block_size=0
  1913.       dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-
  1914.  
  1915.